function treeClick(node,event) {
			//alert(node.isLeaf());
			if(node.isLeaf()){
				event.stopEvent(); 
				var n = tabs.getComponent(node.id); 
				if (!n) { //判断是否已经打开该面板 
					n = tabs.add({ 
					'id':node.id, 
					'title':node.text, 
					closable:true, //通过html载入目标页 
					html:'<iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="'+node.attributes.href+'"></iframe>' 
					}); 
				} 
				tabs.setActiveTab(n);
			}
	}
//生成标签页
var tabs = new Ext.TabPanel({
			region:'center',
			deferredRender:false,
			activeTab:0,
			resizeTabs:true, // turn on tab resizing
			minTabWidth: 115,
			tabWidth:135,
			enableTabScroll:true,
			items:[{
                        contentEl:'center1',
                        title: '我的桌面',
                        autoScroll:true
                 }]
		});

Ext.onReady(function(){
   //layout
	Ext.BLANK_IMAGE_URL = 'ext/resources/images/default/s.gif';
   var viewport = new Ext.Viewport({
		layout:'border',
		items:[
			new Ext.BoxComponent({
				region:'north',
				el: 'north',
				height:50
			}),new Ext.BoxComponent({
				region:'south',
				el: 'south',
				height:25
			}),{
			region:'west',
			id:'west-panel',
			split:true,
			width: 200,
			minSize: 175,
			maxSize: 400,
			margins:'0 0 0 0',
			layout:'accordion',
			title:'系统菜单',
			collapsible :true,
			layoutConfig:{
				animate:true
				},
		    items: [
			    {
					title:'功能菜单',
					border:false,
					html:'<div id="tree-div" style="overflow:auto;width:100%;height:100%"></div>'
					//iconCls:'nav'
			    },{
					title:'信息中心',
					border:false,
					//iconCls:'settings',
					html:'<div id="tree" style="overflow:auto;width:100%;height:100%"></div>'
			    }]
			},
	        tabs//初始标签页
		 ]
	}); 
   var Tree = Ext.tree; 
   //定义根节点的Loader
   var treeloader=new Tree.TreeLoader({dataUrl:WebServiceUrl+'?trancode=Tree&url=1'}); 
   //异步加载根节点
   var rootnode=new Tree.AsyncTreeNode({
        id:'1', 
        text:'目录树根节点'
   });     
   var treepanel = new Tree.TreePanel({                
                el:'tree-div',        //填充区域
                rootVisible:false,     //隐藏根节点
                border:false,          //边框
                animate:true,         //动画效果
                autoScroll:true,      //自动滚动
                enableDD:false,       //拖拽节点              
                containerScroll:true,
                lines:false,
                loader:treeloader             
            }); 
   //设置根节点
   treepanel.setRootNode(rootnode);
   treepanel.render();            
   rootnode.expand(false,false);   
   treepanel.on('click',treeClick);	
    //tree2
    var root2=new Ext.tree.TreeNode({
		    id:"root2",
		    text:"树的根"
		});

    var c1=new Ext.tree.TreeNode({
		id:'c1',
		icon:'images/im2.gif',
		text:'信息征集'
	});
    var c2=new Ext.tree.TreeNode({
		id:'c2',
		icon:'images/im2.gif',
		href:'http://code.google.com/p/ccams/wiki/200808062',
		target:'_blank',
		text:'bug征集'
	});
    var c22=new Ext.tree.TreeNode({
		id:'c22',
		icon:'images/im2.gif',
		href:'http://code.google.com/p/ccams/wiki/20080806',
		target:'_blank',
		text:'实例征集'
	});
    var c3=new Ext.tree.TreeNode({
		id:'c3',
		icon:'images/im2.gif',
		href:'http://code.google.com/p/ccams/wiki/20080806',
		target:'_blank',
		text:'给我留言'
	});
    var c4=new Ext.tree.TreeNode({
		id:'c4',
		icon:'images/im2.gif',
		href:'http://code.google.com/p/ccams/',
		target:'_blank',
		text:'项目主页'
	});
	c1.appendChild(c2);//为c1增加子结点
    c1.appendChild(c22);
	root2.appendChild(c1);//为根节点增加子结点c1
    root2.appendChild(c3);
    root2.appendChild(c4);
    //生成树形面板
	var tree2=new Ext.tree.TreePanel({
		renderTo:"tree",
		root:root2,
		animate:true,
		enableDD:false,
		border:false,
		rootVisible:false,
		containerScroll: true
	});
	//end loding
	setTimeout(
				function() {
					Ext.get('loading').remove();
					Ext.get('loading-mask').fadeOut({remove:true});
				}, 250
			  );
});